#include "stdItem.h"
#include "Resource.h"

stdItem::stdItem(string& filename)
{
	float range;
	rad = ALLEGRO_PI/10;
	int start, end;
	ifstream infile;
	infile.open(filename.c_str());
	Json::Reader reader;
	Json::Value root;
	if (!reader.parse(infile, root, false))
	{
		cout << "json error";
	}
	int size = root.size();

	for (int i = 0; i< size; i++)
	{
		start = root[i]["startBitmap"].asInt();
		end = root[i]["endBitmap"].asInt();
		beginTime = root[i]["BeginTime"].asInt();
		spd = root[i]["speed"].asInt();
		range = root[i]["range"].asInt();
		kind = root[i]["kind"].asInt();
	}

	Resource* r = 0;
	r = r->Instance();
	bitmap.setInformation(r->_arrItem, start, end, range);
}